<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <title>登录界面</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }     
        html {
            height: 100%;
            width: 100%;
            overflow: hidden;
            margin: 0;
            padding: 0;
            background: url(E:/source/material/images/c.jpg) no-repeat 0px 0px;
            background-repeat: no-repeat;
            background-size: 100% 100%;
            -moz-background-size: 100% 100%;
        }         
        body {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
        }       
        #loginDiv {
            width: 35%;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 350px;
            background-color: yellow();
            box-shadow: 7px 7px 17px rgba(52, 56, 66, 0.5);
            border-radius: 5px;
        }         
        #name_trip {
            margin-left: 50px;
            color: red;
        }        
        p {
            margin-top: 30px;
            margin-left: 20px;
            color: rgb(2, 24, 24);
            font-size: 20px;
        }        
        input {
            margin-left: 0px;
            border-radius: 5px;
            border-style: hidden;
            height: 30px;
            width:300px;
            background-color: rgba(204, 180, 204, 0.5);
            outline: none;
            color: #0c0116;
            padding-left: 20px;
        } 
        .button {
            border-color: cornsilk;
            background-color: rgba(100, 149, 237, .7);
            color: aliceblue;
            border-style: hidden;
            border-radius: 5px;
            width: 100px;
            height: 31px;
            font-size: 16px;
            text-align: center;
        }
    </style>

</head>
<div id="loginDiv">
    <div id="form">
        <h1 style="text-align: center;color: rgb(13, 13, 14);">立即登录</h1>
        <p style="text-align: center;">手机号</p>
        <input type="text" placeholder="请输入手机号" id="email"/>
        <p style="text-align: center;">密码</p>
        <input type="password" placeholder="密码长度至少为六位" id="passworld"/>
        </br></br>
        <a href="#" id="forget" style="text-align: center;">忘记密码？</a>
        </br>
        <div style="text-align: center;margin-top: 30px;">
        <button onclick="denlu()" class="button">登录</button>
        
    </div>
    </div>
</div>

<body>
    <script src="./static/layui/layui.js"></script>
    <script>
document.getElementById("b2").onclick = function click(){
        window.location.href="register.html";
    }
    document.getElementById("forget").onclick = function click(){
      window.location.href="register.html";
    }
    email.onchange = function(){
		var email = this.value;
		var reg = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
		if(reg.test(email)){
			//alert("手机号格式正确"); 
		}else{
			alert("手机号格式不正确");
		}
	}
    passworld.onchange = function(){
		var passworld = this.value;
        var reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,12}$/;
		if(reg.test(passworld)){
		}else{
			alert("密码格式不正确");
		}
	}
    function denlu() {
        var p = document.getElementById("passworld").value;
        var e = document.getElementById("email").value;
        var p2=localStorage.getItem("password");
        var e2=localStorage.getItem("email");
        if(p==p2&&e==e2)
            window.location.href="photo wall.html";
        else
            alert("账号或密码不正确");
    }

    </script>
</body>
</html>